import {userInfosDB} from '../entity/UserInfo'

export class UserDaoImpl {
    static userDaoImpl: UserDaoImpl;

    static getInstance(): UserDaoImpl {
        if (!this.userDaoImpl) {
            this.userDaoImpl = new UserDaoImpl();
        }
        return this.userDaoImpl;
    }

    public findUser(username: string, pwd: string) {
        return userInfosDB.find((useinfo) => {
            return username === useinfo.username && pwd === useinfo.password
        })
    }

}

